#include "widget.h"
#include "ui_widget.h"

#include<QSound>
#include<QPushButton>
#include<QFile>
#include<QDebug>
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
     sound=new QSound(":/music.wav",this);
     QFile file(":/music.wav");
     if(!file.exists())
     {
         qDebug()<<"不存在，路径错误";
     }
    connect(ui->pushButton,&QPushButton::clicked,this,[=](){
        sound->play();

    });
}

Widget::~Widget()
{
    delete ui;
}

